$(function(){
	
	var resizeChartContainer = function(location){
		var rightWidth = $("#"+location).width();
		var width = $("#"+location).css("width");
		width = width.replace("px","");
		var padding = Number(width)-rightWidth;
		if(rightWidth>0){
			$("#"+location+"Radar").css("width",(rightWidth-padding)+"px");
			$("#"+location+"Radar").css("height",(rightWidth/1.1)+"px");
		}
	};
	resizeChartContainer("right");
	resizeChartContainer("left");
	var containerR = document.getElementById("rightRadar");
	var containerL = document.getElementById("leftRadar");
	var mychartR = echarts.init(containerR);
	var optionR = {
		    title: {
		        text: '技能'
		    },
		    tooltip: {},
		    legend: {
		        data: ['SKILL']
		    },
		    radar: {
		        indicator: [
		           { name: 'JAVA', max: 100},
		           { name: 'JS', max: 100},
		           { name: 'Oracle,MySql', max: 100},
		           { name: 'Redis', max: 100},
		           { name: 'Spring,Spring Boot', max: 100},
		           { name: 'HTML', max: 100}
		        ]
		    },
		    series: [{
		        name: 'SKILL',
		        type: 'radar',
		        data : [
		            {
		                value : [90, 80, 80, 80, 70,70, 80],
		                name : 'SKILL'
		            }
		        ]
		    }]
		};
	mychartR.setOption(optionR);
	
	var mychartL = echarts.init(containerL);
	var optionL = {
		    title: {
		        text: '技能'
		    },
		    tooltip: {},
		    legend: {
		        data: ['SKILL']
		    },
		    radar: {
		        indicator: [
		           { name: 'JAVA', max: 100},
		           { name: 'JS', max: 100},
		           { name: 'Oracle,MySql', max: 100},
		           { name: 'Redis', max: 100},
		           { name: 'Spring,Spring Boot', max: 100},
		           { name: 'HTML', max: 100}
		        ]
		    },
		    series: [{
		        name: 'SKILL',
		        type: 'radar',
		        data : [
		            {
		                value : [90, 80, 80, 80, 70,70, 80],
		                name : 'SKILL'
		            }
		        ]
		    }]
		};
	mychartL.setOption(optionL);
	
	window.onresize = function () {
	    //重置容器高宽
		resizeChartContainer("right");
	    mychartR.resize();
	    resizeChartContainer("left");
	    mychartL.resize();
	};
});